﻿Imports Microsoft.VisualBasic
Imports System.Collections.Generic

Public Class BasePage
    Inherits System.Web.UI.Page

    Protected Shared LastError As Exception
    Private Sub Page_Error(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Error
        Dim ex As Exception = Server.GetLastError()
        LastError = ex
        Throw ex
    End Sub

    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If SiteSettings.RequireLogin Then
            If Page.User.Identity.IsAuthenticated = False AndAlso Not Page.Title = "User Login" Then Response.Redirect("~/Account/Login.aspx")
        End If

    End Sub
End Class
